Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Managing Draw Contexts

QuickDraw 3D provides a number of general routines for operating with draw context objects.

Q3DrawContext_GetType

You can use the Q3DrawContext_GetType function to get the type of a draw context.

TQ3ObjectType Q3DrawContext_GetType (TQ3DrawContextObject drawContext);
drawContext
A draw context object.

DESCRIPTION

The Q3DrawContext_GetType function returns, as its function result, the type of the draw context specified by the drawContext parameter. The types of draw contexts currently supported by QuickDraw 3D are defined by these constants:

kQ3DrawContextTypeMacintosh
kQ3DrawContextTypePixmap
kQ3DrawContextTypeWin32DC
kQ3DrawContextTypeDDSurface

Q3DrawContext_GetData

You can use the Q3DrawContext_GetData function to get the data associated with a draw context.

TQ3Status Q3DrawContext_GetData (
                     TQ3DrawContextObject context,
                     TQ3DrawContextData *contextData);
context
A draw context object.
contextData
On exit, a pointer to a draw context data structure.

DESCRIPTION

The Q3DrawContext_GetData function returns, in the contextData parameter, a pointer to a draw context data structure for the draw context specified by the context parameter.

Q3DrawContext_SetData

You can use the Q3DrawContext_SetData function to set the data associated with a draw context.

TQ3Status Q3DrawContext_SetData (
                     TQ3DrawContextObject context,
                     const TQ3DrawContextData *contextData);
context
A draw context object.
contextData
A pointer to a draw context data structure.

DESCRIPTION

The Q3DrawContext_SetData function sets the data associated with the draw context specified by the context parameter to that specified in the draw context data structure pointed to by the contextData parameter.

Q3DrawContext_GetClearImageColor

You can use the Q3DrawContext_GetClearImageColor function to get the image clearing color of a draw context.

TQ3Status Q3DrawContext_GetClearImageColor (
                     TQ3DrawContextObject context,
                     TQ3ColorARGB *color);
context
A draw context object.
color
On exit, the current image clearing color of the specified draw context.

DESCRIPTION

The Q3DrawContext_GetClearImageColor function returns, in the color parameter, a constant that indicates the current image clearing color for the draw context specified by the context parameter.

Q3DrawContext_SetClearImageColor

You can use the Q3DrawContext_SetClearImageColor function to set the image clearing color of a draw context.

TQ3Status Q3DrawContext_SetClearImageColor (
                     TQ3DrawContextObject context,
                     const TQ3ColorARGB *color);
context
A draw context object.
color
The desired image clearing color of the specified draw context.

DESCRIPTION

The Q3DrawContext_SetClearImageColor function sets the image clearing color of the draw context specified by the context parameter to the value specified in the color parameter.

Q3DrawContext_GetPane

You can use the Q3DrawContext_GetPane function to get the pane of a draw context.

TQ3Status Q3DrawContext_GetPane (
                     TQ3DrawContextObject context,
                     TQ3Area *pane);
context
A draw context object.
pane
On exit, the area in the specified draw context in which all drawing occurs.

DESCRIPTION

The Q3DrawContext_GetPane function returns, in the pane parameter, the area in the draw context specified by the context parameter in which all drawing occurs.

Q3DrawContext_SetPane

You can use the Q3DrawContext_SetPane function to set the pane of a draw context.

TQ3Status Q3DrawContext_SetPane (
                     TQ3DrawContextObject context,
                     const TQ3Area *pane);
context
A draw context object.
pane
The area in the specified draw context in which all drawing should occur.

DESCRIPTION

The Q3DrawContext_SetPane function sets the area of the draw context specified by the context parameter within which all drawing is to occur to the area specified in the pane parameter.

Q3DrawContext_GetPaneState

You can use the Q3DrawContext_GetPaneState function to get the pane state of a draw context.

TQ3Status Q3DrawContext_GetPaneState (
                     TQ3DrawContextObject context,
                     TQ3Boolean *state);
context
A draw context object.
state
On exit, the current pane state of the specified draw context.

DESCRIPTION

The Q3DrawContext_GetPaneState function returns, in the state parameter, a Boolean value that determines whether the pane associated with the draw context specified by the context parameter is to be used ( kQ3True ) or not ( kQ3False ).

Q3DrawContext_SetPaneState

You can use the Q3DrawContext_SetPaneState function to set the pane state of a draw context.

TQ3Status Q3DrawContext_SetPaneState (
                     TQ3DrawContextObject context,
                     TQ3Boolean state);
context
A draw context object.
state
The desired pane state of the specified draw context.

DESCRIPTION

The Q3DrawContext_SetPaneState function sets the pane state of the draw context specified by the context parameter to the value specified in the state parameter. If the value of state is kQ3True , the pane associated with that draw context is to be used; if kQ3False , the pane is not used.

Q3DrawContext_GetClearImageMethod

You can use the Q3DrawContext_GetClearImageMethod function to get the image clearing method of a draw context.

TQ3Status Q3DrawContext_GetClearImageMethod (
                     TQ3DrawContextObject context,
                     TQ3DrawContextClearImageMethod *method);
context
A draw context object.
method
On exit, the current image clearing method of the specified draw context. See [link] for the values that can be returned in this parameter.

DESCRIPTION

The Q3DrawContext_GetClearImageMethod function returns, in the method parameter, a constant that indicates the current image clearing method for the draw context specified by the context parameter.

Q3DrawContext_SetClearImageMethod

You can use the Q3DrawContext_SetClearImageMethod function to set the image clearing method of a draw context.

TQ3Status Q3DrawContext_SetClearImageMethod (
                     TQ3DrawContextObject context,
                     TQ3DrawContextClearImageMethod method);
context
A draw context object.
method
The desired image clearing method of the specified draw context. See [link] for the values that can be passed in this parameter.

DESCRIPTION

The Q3DrawContext_SetClearImageMethod function sets the image clearing method of the draw context specified by the context parameter to the value specified in the method parameter.

Q3DrawContext_GetMask

You can use the Q3DrawContext_GetMask function to get the mask of a draw context.

TQ3Status Q3DrawContext_GetMask (
                     TQ3DrawContextObject context,
                     TQ3Bitmap *mask);
context
A draw context object.
mask
On exit, the mask of the specified draw context.

DESCRIPTION

The Q3DrawContext_GetMask function returns, in the mask parameter, the current mask for the draw context specified by the context parameter. The mask is a bitmap whose bits determine whether or not corresponding pixels in the drawing destination are drawn or are masked out. Q3DrawContext_GetMask allocates memory internally for the returned bitmap; when you're done using the bitmap, you should call the Q3Bitmap_Empty function to dispose of that memory.

Q3DrawContext_SetMask

You can use the Q3DrawContext_SetMask function to set the mask of a draw context.

TQ3Status Q3DrawContext_SetMask (
                     TQ3DrawContextObject context,
                     const TQ3Bitmap *mask);
context
A draw context object.
mask
The desired mask of the specified draw context.

DESCRIPTION

The Q3DrawContext_SetMask function sets the mask of the draw context specified by the context parameter to the bitmap specified in the mask parameter. Q3DrawContext_SetMask copies the bitmap to internal QuickDraw 3D memory, so you can dispose of the specified bitmap after calling Q3DrawContext_SetMask .

Q3DrawContext_GetMaskState

You can use the Q3DrawContext_GetMaskState function to get the mask state of a draw context.

TQ3Status Q3DrawContext_GetMaskState (
                     TQ3DrawContextObject context,
                     TQ3Boolean *state);
context
A draw context object.
state
On exit, the current mask state of the specified draw context.

DESCRIPTION

The Q3DrawContext_GetMaskState function returns, in the state parameter, a Boolean value that determines whether the mask associated with the draw context specified by the context parameter is to be used ( kQ3True ) or not ( kQ3False ).

Q3DrawContext_SetMaskState

You can use the Q3DrawContext_SetMaskState function to set the mask state of a draw context.

TQ3Status Q3DrawContext_SetMaskState (
                     TQ3DrawContextObject context,
                     TQ3Boolean state);
context
A draw context object.
state
The desired mask state of the specified draw context.

DESCRIPTION

The Q3DrawContext_SetMaskState function sets the mask state of the draw context specified by the context parameter to the value specified in the state parameter. Set state to kQ3True if you want the mask enabled and to kQ3False otherwise.

Q3DrawContext_GetDoubleBufferState

You can use the Q3DrawContext_GetDoubleBufferState function to get the double buffer state of a draw context.

TQ3Status Q3DrawContext_GetDoubleBufferState (
                     TQ3DrawContextObject context,
                     TQ3Boolean *state);
context
A draw context object.
state
On exit, the current mask state of the specified draw context.

DESCRIPTION

The Q3DrawContext_GetDoubleBufferState function returns, in the state parameter, a Boolean value that determines whether double buffering is enabled for the draw context specified by the context parameter ( kQ3True ) or not ( kQ3False ).

Q3DrawContext_SetDoubleBufferState

You can use the Q3DrawContext_SetDoubleBufferState function to set the double buffer state of a draw context.

TQ3Status Q3DrawContext_SetDoubleBufferState (
                     TQ3DrawContextObject context,
                     TQ3Boolean state);
context
A draw context object.
state
The desired mask state of the specified draw context.

DESCRIPTION

The Q3DrawContext_SetDoubleBufferState function sets the double buffer state of the draw context specified by the context parameter to the value specified in the state parameter. Set state to kQ3True if you want the double buffering enabled and to kQ3False otherwise. When you enable double buffering, the active buffer is the back buffer.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |